package com.song.service.impl;

import com.song.mapper.EmpMapper;
import com.song.pojo.Emp;
import com.song.service.EmpService;
import com.song.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Author 宋伟宁
 * @Date 2023/9/7
 * @Version 1.0
 **/
public class EmpServiceImpl implements EmpService {

    private final SqlSession session = MyBatisUtil.getSession();
    private final EmpMapper mapper = session.getMapper(EmpMapper.class);

    @Override
    public List<Emp> findAll() {
        return this.mapper.findAll();
    }

    @Override
    public Emp findById(int eid) {
        return this.mapper.findById(eid);
    }
}
